package com.easyedu.core.util;

import java.util.Random;


/**
 * @author mengranliu
 * @date 2022/3/12
 */
public class RandomUtil {

     private static final Random RANDOM = new Random();

     public static int getRandom(int low, int high) {

          if (low > high) {
               throw new RuntimeException("随机数最小边界大于最大边界");
          }
          if (low == high) {
               return low;
          }
          int large = high - low + 1;
          return low + RANDOM.nextInt(large);
     }

}
